<?php
require_once('Zend/View/Helper/Abstract.php');

class Kbs_View_Helper_Img extends Zend_View_Helper_Abstract
{
    public function img($src, $width, $height, $alt = '', $options = array())
    {
        if (empty($alt)) {
            throw new Zend_View_Exception('Alt attribute should be filled.');
        }

        $basepath = $this->view->serverUrl() . $this->view->pathImg;
        $img = '<img src="' . $basepath . $src . '" width="' . $width . '" height="' . $height . '" alt="' . $alt . '" />';
        return $img;
    }
}